// -------------------------------------------------------------------------------------------------

#if !defined( __meta_system_test_h__ )
#define __meta_system_test_h__

/**
 * @brief 
 * Internal API to invoke action function by index
 * Dissected:
 *      MetaAction => ma = sm.registry( )->m_actions[ actionindex ]
 *      StateMachine::ActionFunction => af = ma->getFunction( );
 *      Invocation => ( ( sm ).*( af ) )( NULL );
 */
#define INVOKE_ACTION_BY_INDEX( instance, action_index, param ) \
    ( ( instance ).*( instance.registry( )->m_actions[ action_index ] ).getFunction( ) )( param )

/**
 * @brief 
 * Test/debug API to invoke action function by its name
 * Script induced invoke
 */
#define INVOKE_ACTION_BY_NAME( instance, action_name, param ) \
    ( ( instance ).*( instance.registry( )->m_action_map[ #action_name ] ).getFunction( ) )( param )

/**
 * @brief 
 * Test/debug API to get event id by index.
 */
#define EVENT_BY_INDEX( instance, event_index ) \
    ( instance.registry( )->m_events[ event_index ] )( )

/**
 * @brief 
 * Script API to get event id by its name
 */
#define EVENT_BY_NAME( instance, event_name ) \
    ( instance.registry( )->m_event_map[ #event_name ] )( )


void test_meta_system( );

#endif

// -------------------------------------------------------------------------------------------------
